<script type="text/javascript" >
    stFacebookToolbox.sortColumn();
    stFacebookToolbox.shortAction();
</script>

<div class="w100p bgl">
    <div class="w100p bgr">
        <div class="inner_container">
                            <br />
                            <a style="cursor: pointer" onclick="stFacebookToolboxcustom.update_search();" class="button add-new-h2">
                       <b>SEARCH NOW</b>
                    </a>
                <input type="hidden" id="picture" value="<?php echo $plugin_url;?>images/mini-loading.gif" />
                <div id="facebook_search" align="center"></div>
                <p></p>
            <table class="widefat" cellspacing="0">
                <thead>
                    <tr>
                        <?php print_column_headers('stFacebookToolbox_stFacebookToolbox'); ?>
                    </tr>
                </thead>

                <tbody>
                <?php
                if (count($results) > 0) {
                    $tr_class = "";
                    foreach ($results as $result) {
                        if( empty($tr_class) || $tr_class == "class='bg_gray2'"){
                            $tr_class = "class='bg_gray1'";
                        }else{
                            $tr_class = "class='bg_gray2'";
                        }
                        echo "<tr id='$result->id' $tr_class >"
                        . "<td>" . $result->searchtermid
                        . "<div class=\"row-actions short_action\">"
                        . "<span class='edit' action='add_facebook_search' short_action='' id='$result->searchtermid'>Edit | </span>"
                        . "<span class='trash' short_action='delete' id='$result->searchtermid' confirm='Are you sure you want to delete this search term?'>Trash </span>"
                        . "</div>"

                        . "</td>"
                        . "<td>" . $result->searchterm . "</td>"
                        . "</tr>"
                        ;
                        $facebook_search[$result->searchtermid] = $result->searchterm;
                    }
                    
                }
                ?>
                </tbody>
            </table>
                <input type="hidden" id="list_page" value='<?php echo json_encode($facebook_search);?>' />
            <div class="page_d">
                <?php echo $pagination?>
                <div class="cl"></div>
            </div>

        </div>
    </div>
</div>